agora inbox for [email protected]  
help / color / mirror / Atom feed
Patch to fix write after end of array in hashed agg initialization
1932+ messages / 4 participants
[nested] [flat]

* Patch to fix write after end of array in hashed agg initialization
@ 2019-05-22 01:03 Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  0 siblings, 1 reply; 1932+ messages in thread

From: Colm McHugh @ 2019-05-22 01:03 UTC (permalink / raw)
  To: pgsql-hackers

Attached is a patch for a write after allocated memory which we found in
testing. Its an obscure case but can happen if the same column is used in
different grouping keys, as in the example below, which uses tables from
the regress test suite (build with --enable-cassert in order to turn on
memory warnings). Patch is against master.

The hashed aggregate state has an array for the column indices that is
sized using the number of non-aggregated columns in the set that includes
the agg's targetlist, quals and input grouping columns. The duplicate
elimination of columns can result in under-allocation, as below. Sizing
based on the number of grouping columns and number of quals/targetlists not
in the grouping columns avoids this.

Regards,
Colm McHugh (Salesforce)

explain (costs off) select 1 from tenk where (hundred, thousand) in (select
twothousand, twothousand from onek);

psql: WARNING:  problem in alloc set ExecutorState: detected write past
chunk end in block 0x7f8b8901fa00, chunk 0x7f8b89020cd0

psql: WARNING:  problem in alloc set ExecutorState: detected write past
chunk end in block 0x7f8b8901fa00, chunk 0x7f8b89020cd0

                         QUERY PLAN

-------------------------------------------------------------

 Hash Join

   Hash Cond: (tenk.hundred = onek.twothousand)

   ->  Seq Scan on tenk

         Filter: (hundred = thousand)

   ->  Hash

         ->  HashAggregate

               Group Key: onek.twothousand, onek.twothousand

               ->  Seq Scan on onek
(8 rows)


Attachments:

  [application/x-patch] 0001-Fix-write-after-end-of-array-in-hashed-Agg-initializ.patch (5.5K, ../../CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com/3-0001-Fix-write-after-end-of-array-in-hashed-Agg-initializ.patch)
  download | inline diff:
From 39e2a404909e34de82a17be9110dc9f42a38823c Mon Sep 17 00:00:00 2001
From: Colm McHugh <[email protected]>
Date: Fri, 17 May 2019 15:32:52 -0700
Subject: [PATCH] Fix write after end of array in hashed Agg initialization.

The array for the column indices in the per-hashtable data structure
may be under-allocated in some corner cases, resulting in a write
after the end of this array. Using the number of grouping columns and
number of other columns in the qualifier and targetlist (if any) to
size the array avoids the corner cases where this can happen.
---
 src/backend/executor/nodeAgg.c           | 28 +++++++++++++++++-----------
 src/test/regress/expected/aggregates.out | 27 +++++++++++++++++++++++++++
 src/test/regress/sql/aggregates.sql      |  4 ++++
 3 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index d01fc4f..079bffd 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -1331,14 +1331,23 @@ find_hash_columns(AggState *aggstate)
 	for (j = 0; j < numHashes; ++j)
 	{
 		AggStatePerHash perhash = &aggstate->perhash[j];
-		Bitmapset  *colnos = bms_copy(base_colnos);
+		Bitmapset  *grouping_colnos = NULL;
+		Bitmapset  *non_grouping_colnos = NULL;
 		AttrNumber *grpColIdx = perhash->aggnode->grpColIdx;
 		List	   *hashTlist = NIL;
 		TupleDesc	hashDesc;
 		int			i;
+		int			hashGrpColIdxSize = 0;
 
 		perhash->largestGrpColIdx = 0;
 
+		/* Populate grouping_colnos - this is the set of all the grouping columns */
+		for (i = 0; i < perhash->numCols; i++)
+			grouping_colnos = bms_add_member(grouping_colnos, grpColIdx[i]);
+
+		/* Determine remaining columns (if any) */
+		non_grouping_colnos = bms_difference(base_colnos, grouping_colnos);
+
 		/*
 		 * If we're doing grouping sets, then some Vars might be referenced in
 		 * tlist/qual for the benefit of other grouping sets, but not needed
@@ -1356,15 +1365,13 @@ find_hash_columns(AggState *aggstate)
 				int			attnum = lfirst_int(lc);
 
 				if (!bms_is_member(attnum, grouped_cols))
-					colnos = bms_del_member(colnos, attnum);
+					non_grouping_colnos = bms_del_member(non_grouping_colnos, attnum);
 			}
 		}
-		/* Add in all the grouping columns */
-		for (i = 0; i < perhash->numCols; i++)
-			colnos = bms_add_member(colnos, grpColIdx[i]);
-
+		/* allocate a slot for each grouping column and remaining column */
+		hashGrpColIdxSize = perhash->numCols + bms_num_members(non_grouping_colnos);
 		perhash->hashGrpColIdxInput =
-			palloc(bms_num_members(colnos) * sizeof(AttrNumber));
+			palloc(hashGrpColIdxSize * sizeof(AttrNumber));
 		perhash->hashGrpColIdxHash =
 			palloc(perhash->numCols * sizeof(AttrNumber));
 
@@ -1380,12 +1387,10 @@ find_hash_columns(AggState *aggstate)
 			perhash->hashGrpColIdxInput[i] = grpColIdx[i];
 			perhash->hashGrpColIdxHash[i] = i + 1;
 			perhash->numhashGrpCols++;
-			/* delete already mapped columns */
-			bms_del_member(colnos, grpColIdx[i]);
 		}
 
 		/* and add the remaining columns */
-		while ((i = bms_first_member(colnos)) >= 0)
+		while ((i = bms_first_member(non_grouping_colnos)) >= 0)
 		{
 			perhash->hashGrpColIdxInput[perhash->numhashGrpCols] = i;
 			perhash->numhashGrpCols++;
@@ -1412,7 +1417,8 @@ find_hash_columns(AggState *aggstate)
 							   &TTSOpsMinimalTuple);
 
 		list_free(hashTlist);
-		bms_free(colnos);
+		bms_free(grouping_colnos);
+		bms_free(non_grouping_colnos);
 	}
 
 	bms_free(base_colnos);
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index 129c1e5..3ef7ac9 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -2265,3 +2265,30 @@ select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
  ba       |    0 |     1
 (2 rows)
 
+explain (costs off) delete from tenk1 where (hundred, thousand) in (select twothousand, twothousand from onek);
+                            QUERY PLAN                             
+-------------------------------------------------------------------
+ Delete on tenk1
+   ->  Hash Join
+         Hash Cond: (tenk1.hundred = onek.twothousand)
+         ->  Seq Scan on tenk1
+               Filter: (hundred = thousand)
+         ->  Hash
+               ->  HashAggregate
+                     Group Key: onek.twothousand, onek.twothousand
+                     ->  Seq Scan on onek
+(9 rows)
+
+explain (costs off) select 1 from tenk1 where (hundred, thousand) in (select twothousand, twothousand from onek); 
+                         QUERY PLAN                          
+-------------------------------------------------------------
+ Hash Join
+   Hash Cond: (tenk1.hundred = onek.twothousand)
+   ->  Seq Scan on tenk1
+         Filter: (hundred = thousand)
+   ->  Hash
+         ->  HashAggregate
+               Group Key: onek.twothousand, onek.twothousand
+               ->  Seq Scan on onek
+(8 rows)
+
diff --git a/src/test/regress/sql/aggregates.sql b/src/test/regress/sql/aggregates.sql
index d4fd657..5bd77d4 100644
--- a/src/test/regress/sql/aggregates.sql
+++ b/src/test/regress/sql/aggregates.sql
@@ -987,3 +987,7 @@ select v||'a', case v||'a' when 'aa' then 1 else 0 end, count(*)
 select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
   from unnest(array['a','b']) u(v)
  group by v||'a' order by 1;
+
+explain (costs off) delete from tenk1 where (hundred, thousand) in (select twothousand, twothousand from onek);
+
+explain (costs off) select 1 from tenk1 where (hundred, thousand) in (select twothousand, twothousand from onek);
-- 
2.7.4



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
@ 2019-05-22 15:11 ` Tom Lane <[email protected]>
  2019-05-23 00:36   ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  0 siblings, 1 reply; 1932+ messages in thread

From: Tom Lane @ 2019-05-22 15:11 UTC (permalink / raw)
  To: Colm McHugh <[email protected]>; +Cc: pgsql-hackers; Andrew Gierth <[email protected]>

Colm McHugh <[email protected]> writes:
> Attached is a patch for a write after allocated memory which we found in
> testing. Its an obscure case but can happen if the same column is used in
> different grouping keys, as in the example below, which uses tables from
> the regress test suite (build with --enable-cassert in order to turn on
> memory warnings). Patch is against master.

I confirm the appearance of the memory-overwrite warnings in HEAD.

It looks like the bad code is (mostly) the fault of commit b5635948.
Andrew, can you take a look at this fix?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
@ 2019-05-23 00:36   ` Andrew Gierth <[email protected]>
  2019-05-23 03:49     ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  0 siblings, 1 reply; 1932+ messages in thread

From: Andrew Gierth @ 2019-05-23 00:36 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Colm McHugh <[email protected]>; pgsql-hackers

>>>>> "Tom" == Tom Lane <[email protected]> writes:

 >> Attached is a patch for a write after allocated memory which we
 >> found in testing. Its an obscure case but can happen if the same
 >> column is used in different grouping keys, as in the example below,
 >> which uses tables from the regress test suite (build with
 >> --enable-cassert in order to turn on memory warnings). Patch is
 >> against master.

 Tom> I confirm the appearance of the memory-overwrite warnings in HEAD.

 Tom> It looks like the bad code is (mostly) the fault of commit
 Tom> b5635948. Andrew, can you take a look at this fix?

I'll look into it.

-- 
Andrew (irc:RhodiumToad)





^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  2019-05-23 00:36   ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
@ 2019-05-23 03:49     ` Andrew Gierth <[email protected]>
  2019-05-23 04:02       ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  2019-05-23 10:44       ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  0 siblings, 2 replies; 1932+ messages in thread

From: Andrew Gierth @ 2019-05-23 03:49 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; Andres Freund <[email protected]>; +Cc: Colm McHugh <[email protected]>; pgsql-hackers

>>>>> "Andrew" == Andrew Gierth <[email protected]> writes:

 >>> Attached is a patch for a write after allocated memory which we
 >>> found in testing. Its an obscure case but can happen if the same
 >>> column is used in different grouping keys, as in the example below,
 >>> which uses tables from the regress test suite (build with
 >>> --enable-cassert in order to turn on memory warnings). Patch is
 >>> against master.

 Andrew> I'll look into it.

OK, so my first impression is that this is down to (a) the fact that
when planning a GROUP BY, we eliminate duplicate grouping keys; (b) due
to (a), the executor code isn't expecting to have to deal with
duplicates, but (c) when using a HashAgg to implement a Unique path, the
planner code isn't making any attempt to eliminate duplicates so they
get through.

It was wrong before commit b5635948, looks like Andres' fc4b3dea2 which
introduced the arrays and the concept of narrowing the stored tuples is
the actual culprit. But I'll deal with fixing it anyway unless Andres
has a burning desire to step in.

My inclination is to fix this in the planner rather than the executor;
there seems no good reason to actually hash a duplicate column more than
once.

-- 
Andrew (irc:RhodiumToad)





^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  2019-05-23 00:36   ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  2019-05-23 03:49     ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
@ 2019-05-23 04:02       ` Tom Lane <[email protected]>
  2019-05-23 04:11         ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  1 sibling, 1 reply; 1932+ messages in thread

From: Tom Lane @ 2019-05-23 04:02 UTC (permalink / raw)
  To: Andrew Gierth <[email protected]>; +Cc: Andres Freund <[email protected]>; Colm McHugh <[email protected]>; pgsql-hackers

Andrew Gierth <[email protected]> writes:
> My inclination is to fix this in the planner rather than the executor;
> there seems no good reason to actually hash a duplicate column more than
> once.

Sounds reasonable --- but would it make sense to introduce some
assertions, or other cheap tests, into the executor to check that
it's not being given a case it can't handle?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  2019-05-23 00:36   ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  2019-05-23 03:49     ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  2019-05-23 04:02       ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
@ 2019-05-23 04:11         ` Andrew Gierth <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Andrew Gierth @ 2019-05-23 04:11 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Andres Freund <[email protected]>; Colm McHugh <[email protected]>; pgsql-hackers

>>>>> "Tom" == Tom Lane <[email protected]> writes:

 > Andrew Gierth <[email protected]> writes:
 >> My inclination is to fix this in the planner rather than the
 >> executor; there seems no good reason to actually hash a duplicate
 >> column more than once.

 Tom> Sounds reasonable --- but would it make sense to introduce some
 Tom> assertions, or other cheap tests, into the executor to check that
 Tom> it's not being given a case it can't handle?

Oh definitely, I was planning on it.

-- 
Andrew (irc:RhodiumToad)





^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* Re: Patch to fix write after end of array in hashed agg initialization
  2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
  2019-05-22 15:11 ` Re: Patch to fix write after end of array in hashed agg initialization Tom Lane <[email protected]>
  2019-05-23 00:36   ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
  2019-05-23 03:49     ` Re: Patch to fix write after end of array in hashed agg initialization Andrew Gierth <[email protected]>
@ 2019-05-23 10:44       ` Andrew Gierth <[email protected]>
  1 sibling, 0 replies; 1932+ messages in thread

From: Andrew Gierth @ 2019-05-23 10:44 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Andres Freund <[email protected]>; Colm McHugh <[email protected]>; pgsql-hackers

>>>>> "Andrew" == Andrew Gierth <[email protected]> writes:

 Andrew> My inclination is to fix this in the planner rather than the
 Andrew> executor; there seems no good reason to actually hash a
 Andrew> duplicate column more than once.

I take this back; I don't believe it's possible to eliminate duplicates
in all cases. Consider (a,b) IN (select c,c from...), where a,b,c are
different types; I don't think we can assume that (a=c) and (b=c)
cross-type comparisons will necessarily induce the same hash function on
c, and so we might legitimately need to keep it duplicated.

So I'm going with a simpler method of ensuring the array is adequately
sized at execution time and not touching the planner at all. Draft patch
is attached, will commit it later.

-- 
Andrew (irc:RhodiumToad)



Attachments:

  [text/x-patch] hashfix.patch (4.2K, ../../[email protected]/2-hashfix.patch)
  download | inline diff:
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 5b4a602952..6b8ef40599 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -1312,9 +1312,14 @@ build_hash_table(AggState *aggstate)
  * by themselves, and secondly ctids for row-marks.
  *
  * To eliminate duplicates, we build a bitmapset of the needed columns, and
- * then build an array of the columns included in the hashtable.  Note that
- * the array is preserved over ExecReScanAgg, so we allocate it in the
- * per-query context (unlike the hash table itself).
+ * then build an array of the columns included in the hashtable. We might
+ * still have duplicates if the passed-in grpColIdx has them, which can happen
+ * in edge cases from semijoins/distinct; these can't always be removed,
+ * because it's not certain that the duplicate cols will be using the same
+ * hash function.
+ *
+ * Note that the array is preserved over ExecReScanAgg, so we allocate it in
+ * the per-query context (unlike the hash table itself).
  */
 static void
 find_hash_columns(AggState *aggstate)
@@ -1335,6 +1340,7 @@ find_hash_columns(AggState *aggstate)
 		AttrNumber *grpColIdx = perhash->aggnode->grpColIdx;
 		List	   *hashTlist = NIL;
 		TupleDesc	hashDesc;
+		int			maxCols;
 		int			i;
 
 		perhash->largestGrpColIdx = 0;
@@ -1359,15 +1365,24 @@ find_hash_columns(AggState *aggstate)
 					colnos = bms_del_member(colnos, attnum);
 			}
 		}
-		/* Add in all the grouping columns */
-		for (i = 0; i < perhash->numCols; i++)
-			colnos = bms_add_member(colnos, grpColIdx[i]);
+
+		/*
+		 * Compute maximum number of input columns accounting for possible
+		 * duplications in the grpColIdx array, which can happen in some edge
+		 * cases where HashAggregate was generated as part of a semijoin or a
+		 * DISTINCT.
+		 */
+		maxCols = bms_num_members(colnos) + perhash->numCols;
 
 		perhash->hashGrpColIdxInput =
-			palloc(bms_num_members(colnos) * sizeof(AttrNumber));
+			palloc(maxCols * sizeof(AttrNumber));
 		perhash->hashGrpColIdxHash =
 			palloc(perhash->numCols * sizeof(AttrNumber));
 
+		/* Add all the grouping columns to colnos */
+		for (i = 0; i < perhash->numCols; i++)
+			colnos = bms_add_member(colnos, grpColIdx[i]);
+
 		/*
 		 * First build mapping for columns directly hashed. These are the
 		 * first, because they'll be accessed when computing hash values and
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index fed69dc9e1..2e5ce8cc32 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -2270,3 +2270,21 @@ select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
  ba       |    0 |     1
 (2 rows)
 
+-- Make sure that generation of HashAggregate for uniqification purposes
+-- does not lead to array overflow due to unexpected duplicate hash keys
+-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
+explain (costs off)
+  select 1 from tenk1
+   where (hundred, thousand) in (select twothousand, twothousand from onek);
+                         QUERY PLAN                          
+-------------------------------------------------------------
+ Hash Join
+   Hash Cond: (tenk1.hundred = onek.twothousand)
+   ->  Seq Scan on tenk1
+         Filter: (hundred = thousand)
+   ->  Hash
+         ->  HashAggregate
+               Group Key: onek.twothousand, onek.twothousand
+               ->  Seq Scan on onek
+(8 rows)
+
diff --git a/src/test/regress/sql/aggregates.sql b/src/test/regress/sql/aggregates.sql
index 230f44666a..ca0d5e66b2 100644
--- a/src/test/regress/sql/aggregates.sql
+++ b/src/test/regress/sql/aggregates.sql
@@ -988,3 +988,10 @@ select v||'a', case v||'a' when 'aa' then 1 else 0 end, count(*)
 select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
   from unnest(array['a','b']) u(v)
  group by v||'a' order by 1;
+
+-- Make sure that generation of HashAggregate for uniqification purposes
+-- does not lead to array overflow due to unexpected duplicate hash keys
+-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
+explain (costs off)
+  select 1 from tenk1
+   where (hundred, thousand) in (select twothousand, twothousand from onek);


^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread


end of thread, other threads:[~2026-04-03 19:08 UTC | newest]

Thread overview: 1932+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 01:03 Patch to fix write after end of array in hashed agg initialization Colm McHugh <[email protected]>
2019-05-22 15:11 ` Tom Lane <[email protected]>
2019-05-23 00:36   ` Andrew Gierth <[email protected]>
2019-05-23 03:49     ` Andrew Gierth <[email protected]>
2019-05-23 04:02       ` Tom Lane <[email protected]>
2019-05-23 04:11         ` Andrew Gierth <[email protected]>
2019-05-23 10:44       ` Andrew Gierth <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox